﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace cloud_music.chuangjiangedan_ng
{
    public partial class chuang_Form1 : Form
    {
        public chuang_Form1()
        {
            InitializeComponent();
        }
        //窗体加载事件
        private void chuang_Form1_Load(object sender, EventArgs e)
        {

        }
        /// <summary>
        /// 确定按钮事件   confirm
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void butconfirm_Click(object sender, EventArgs e)
        {
            string name = "";
            string password = "";
            //验证登录名非空
            textBox1.Focus();
            if (textBox1.Text.Length != 0)//&& textBox2.Text.Length != 0)
            {
                name = textBox1.Text;
                // string password = textBox2.Text;

                //验证密码非空
                if (textBox2.Text.Length != 0)
                {
                    password = textBox2.Text;

                
                    //返回数值
                    //连接存不存在
                    if (chekID == 1)
                    {
                        GuanLiYuan caozuo = new GuanLiYuan();

                        caozuo.Show();
                    }
                    else
                    {
                        MessageBox.Show("用户名或密码错误请重新输入！", "温馨提示");
                    }

                }
                else
                {
                    textBox2.Focus();//设置焦点  把光标停留在输入密码上
                    MessageBox.Show("请输入密码！", "确定");
                }
            }
            else
            {
                textBox1.Focus();//设置焦点  把光标停留在输入name上
                MessageBox.Show("请输入用户名！", "确定");
            }

        }
    }
        /// <summary>
        /// 取消按钮事件     cancel
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void butcancel_Click(object sender, EventArgs e)
        {

        }

        //
    }
}
